#define DEBUG
#include <cstdio>
#include <cstring>

using namespace std;

const int maxn=100, maxm=100;

long long max(long long a, long long b) {
  return a>b ? a : b;
}

int main() {
  freopen("maja.in", "r", stdin);
  freopen("maja.out", "w", stdout);

  static long long c[maxn+1][maxm+1];
  int n, m, a, b;
  long long k;
  scanf("%d %d %d %d %lld", &n, &m, &a, &b, &k);
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=m; j++) {
      scanf("%lld", &c[i][j]);
    }
  }

  const int fx[4][2]= {{-1, 0}, {0, -1}, {0, 1}, {1, 0}};
  static long long f[2][maxn+1][maxm+1];
  memset(f, 128, sizeof f);
  f[0][a][b] = c[a][b];
  long long ans=0;
  for (int t=1; t<=k/2 && t<=n*m; t++) {
    for (int i=1; i<=n; i++) {
      for (int j=1; j<=m; j++) {
	long long maxc=0;
	for (int l=0; l<4; l++) {
	  int nx=i+fx[l][0], ny=j+fx[l][1];
	  if (nx>0 && ny>0 && nx<=n && ny<=m) {
	    f[t%2][i][j] = max(f[(t-1)%2][nx][ny]+c[i][j], f[t%2][i][j]);
	    maxc = max(maxc, c[nx][ny]);
	  }
	}
	if (f[t%2][i][j]>0) {
	  ans = max(ans, f[t%2][i][j]*2+(maxc+c[i][j])*(k/2-t)-c[i][j]);
	}
      }
    }
  }

  printf("%lld", ans);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
